import { lib, game, ui, get, ai, _status } from "../../noname.js";
import card from "./card/card.js";

/**
 * 子包列表
 */
const packList = [
    card,     //
];

/**
 * 将子包列表中成员的指定子对象拼接为对象
 * @param {String} key 指定子对象键名
 * @returns {Object} 由指定子对象组成的对象
 */
function memberToString(key) {
    let str = '';
    for (let i = 0; i < packList.length; i++) {
        if (packList[i][key])
            str += `...packList[${i}].${key},`;
    }
    return eval('({' + str.slice(0, -1) + '})');
}

/**
 * 原始的卡牌包
 */
const packs = {
    name: "DALF_card",
    connect: true,
    translate: memberToString('translate'),
    card: memberToString('card'),
    skill: memberToString('skill'),
    list: []
}

/**
 * 向游戏内加入武将包
 */
game.import("card", function () {
    return packs;
});
lib.translate['DALF_card_card_config'] = "约会大作战";
if (!lib.config.cards.includes('DALF_card')) lib.config.cards.push('DALF_card');